Morphological Gradient
Emphasizes the boundaries of objects in a binary or grayscale image by calculating the difference between the dilation and erosion of the image.
🖼️ Image options and parameters of morphologicalGradient
method
🎭 Mask options and parameters of morphologicalGradient
method
The morphological gradient is a mathematical operation used in image processing and mathematical morphology to highlight the boundaries of objects or regions within an image. It is a fundamental concept in morphological image analysis and is often used for tasks such as edge detection and image segmentation. The morphological gradient is based on the difference between an image after dilation and the same image after erosion.
Applying morphological gradient on Images:


Kinds of images compatible with algorithm
Image property | What it means | Possible values |
---|---|---|
bitDepth | number of bits per channel | [1,8,16] |
components | number of components | [1] |
alpha | is alpha channel allowed | false |
Parameters and default values
Parameters and options for Images and Masks are the same.
options
Options
Property | Required | Default value |
---|---|---|
iterations | no | 1 |
kernel | no | [[1, 1, 1],[1, 1, 1],[1, 1, 1]] |
The method is also available for Masks.